package org.dtrd.modules.questionnaire.entity.bean;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.archive.entity.po.DtrdEntRdArchiveOverview;
import org.dtrd.modules.archive.entity.po.DtrdEntRdArchivePhysical;

/**
 * @author qr
 * @date 2022/2/28 15:59
 */
@ApiModel("患者详细信息")
@Getter
@Setter
public class PatientDetailInfo {

    @ApiModelProperty(value = "患者id", required = true)
    private Integer patientId;

    @ApiModelProperty("体重")
    private Float weight;

    @ApiModelProperty("身高")
    private Float height;

    @ApiModelProperty("腰围")
    private Float waistline;

    @ApiModelProperty("C肽")
    private Float cPeptide;

    @ApiModelProperty("C肽-餐后两小时")
    private Float cPeptide2h;

    @ApiModelProperty("糖化血红蛋白")
    private Float hba1c;

    @ApiModelProperty("空腹血糖")
    private Float sugarFasting;

    @ApiModelProperty("餐后2小时")
    private Float sugar2h;

    @ApiModelProperty("2小时胰岛素")
    private Float insulin2h;

    @ApiModelProperty("是否完成, 1-是，0-否")
    @JsonIgnore
    private Integer isFinished = 0;

    public PatientDetailInfo() {}

    public PatientDetailInfo(Integer patientId) {
        this.patientId = patientId;
    }

    public PatientDetailInfo parseFromPO(DtrdEntRdArchiveOverview overview) {
        hba1c = overview.getHba1c();
        cPeptide = overview.getCPeptide();
        cPeptide2h = overview.getCPeptide2h();
        sugarFasting = overview.getSugarFasting();
        sugar2h = overview.getSugar2h();
        insulin2h = overview.getInsulin2h();
        return this;
    }

    public PatientDetailInfo parseFromPO(DtrdEntRdArchivePhysical physical) {
        weight = physical.getWeight();
        height = physical.getHeight();
        waistline = physical.getWaist();
        return this;
    }
}
